Page({
  onLoad() {
    this.getVisitorList()
  },
  //查询访客邀请列表-邀请记录
  async getVisitorList() {
    const res = await wx.http.get('/visitor', { current: 1, pageSize: 20 })
    this.setData({
      visitorList: res.data.rows
    })
  },
  goPassport(e) {
    const { status, id } = e.mark
    if (status === 0) return wx.utils.toast('通行证失效')
    wx.navigateTo({
      url: '/visitor_pkg/pages/passport/index?id=' + id,
    })
  },
})
